<!DOCTYPE HTML>
<html>
<head>
<title>登录也</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>

<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />

<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />

<!-- font-awesome icons CSS-->
<link href="css/font-awesome.css" rel="stylesheet">
<!-- //font-awesome icons CSS-->

 <!-- side nav css file -->
 <link href='css/SidebarNav.min.css' media='all' rel='stylesheet' type='text/css'/>
 <!-- side nav css file -->
 
 <!-- js-->
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/modernizr.custom.js"></script>

 
<!-- Metis Menu -->
<script src="js/metisMenu.min.js"></script>
<script src="js/custom.js"></script>
<link href="css/custom.css" rel="stylesheet">
<!--//Metis Menu -->

</head> 
<body>
<div class="main-content">
		<!-- main content start-->
		<h2 style="text-align: center;" class="title1">学校管理平台</h2>
		<div id="page-wrapper">
			<div class="main-page login-page ">
				<h2 class="title1">登录</h2>
				<div class="widget-shadow">
					<div class="login-body">
						<form id="userForm" method="post">
                            <span id="content" style="color: red;"></span>
							<input type="text"
                                   style="padding: 14px 15px 14px 37px;width: 100%;margin-bottom: 10px;" class="user" name="username" placeholder="登录账号" required="">
							<input type="password" name="password" class="lock" placeholder="登录密码" required="">
							<div class="forgot-grid">
								<div class="forgot">
									<a href="#">忘记密码</a>
								</div>
								<div class="clearfix"> </div>
							</div>
							<input onclick="loginForm()" type="button"  value="登录">
<!--                            <a href="home.do" name="login" type="submit">登录</a>-->
							<div class="registration">
								还未注册
								<a class="" href="signup.html">
									点击注册
								</a>
							</div>
						</form>
					</div>
				</div>
				
			</div>
		</div>
		<!--footer-->
		<div class="footer">
		   <p>&copy; 2018 Glance Design Dashboard. All Rights Reserved | Design by <a href="https://w3layouts.com/" target="_blank">w3layouts</a></p>		</div>
        <!--//footer-->
	</div>
	
	<!-- side nav js -->
	<script src='js/SidebarNav.min.js' type='text/javascript'></script>
	<script>
      $('.sidebar-menu').SidebarNav()

        function loginForm() {
            let formData = $("#userForm").serialize()
            $.ajax({
                url:"user/login.do",
                type:"post",
                data:formData,
                dataType:"json",
                success:function (data) {
                    if(data){
                        window.location.href="home.do";
                    }else{
                        $("#content").text("账号或密码错误")
                    }
                }
            })
        }
    </script>
	<!-- //side nav js -->
	
	<!-- Classie --><!-- for toggle left push menu script -->
		<script src="js/classie.js"></script>
		<script>
			var menuLeft = document.getElementById( 'cbp-spmenu-s1' ),
				showLeftPush = document.getElementById( 'showLeftPush' ),
				body = document.body;
				
			showLeftPush.onclick = function() {
				classie.toggle( this, 'active' );
				classie.toggle( body, 'cbp-spmenu-push-toright' );
				classie.toggle( menuLeft, 'cbp-spmenu-open' );
				disableOther( 'showLeftPush' );
			};
			
			function disableOther( button ) {
				if( button !== 'showLeftPush' ) {
					classie.toggle( showLeftPush, 'disabled' );
				}
			}
		</script>
	<!-- //Classie --><!-- //for toggle left push menu script -->
		
	<!--scrolling js-->
	<script src="js/jquery.nicescroll.js"></script>
	<script src="js/scripts.js"></script>
	<!--//scrolling js-->
	
	<!-- Bootstrap Core JavaScript -->
   <script src="js/bootstrap.js"> </script>
	<!-- //Bootstrap Core JavaScript -->
   
</body>
</html>